<?php
namespace Home\Controller;
use Think\Controller;
class videoController extends Controller {
	public function getIsPostRequest(){
        return isset($_SERVER['REQUEST_METHOD']) && !strcasecmp($_SERVER['REQUEST_METHOD'],'POST');
	}
    public function getAllvideo(){
         $video=M('video')
	   $data=video->order('vid asc')->select();
	   echo json_encode($data);
    }
     public function getvideoById(){
     	if(getIsPostRequest()){
        $vid=$_GET['vid'];
       }
       else{
       	$vid=$_POST['vid'];
       }
        $video=M('video');
        $data=video->where("vid=$vid")->select();
        echo json_encode($data);
    }
}